<%@page contentType="text/html" %>
<%@page contentType="text/html" %>
<%@page pageEncoding="UTF-8" %>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Goodwill - Прейскурант</title>
    <link rel="stylesheet" href="resources/css/main.css"/>
    <link rel="stylesheet" href="resources/css/stylesheet.css"/>
    <link rel="stylesheet" href="resources/css/simple_tables.css"/>
    <script type="text/javascript" src="resources/js/hltable.js"></script>
    <style type="text/css">
        .hooverRow {
            background-color: yellow;
        }
    </style>
</head>
<body>
<f:view>

    <jsp:include page="menu.jsp"/>
    <jsp:include page="status.jsp"/>
    <jsp:include page="messages.jsp"/>

    <h:panelGroup styleClass="" layout="block" style="padding:5px">

        <!-- Фильтр -->
        <h:panelGroup id="filter" style="white-space:nowrap;">
            <h:form prependId="false">
                <h:outputText value="Группа товара"/>
                <h:selectOneMenu value="#{PricelistsPlain.goodTypeId}" styleClass="f_s" onchange="this.form.submit();">
                    <f:selectItems value="#{GoodTypesBean.goodTypesAsSelectItems2}"/>
                </h:selectOneMenu>
            </h:form>
        </h:panelGroup>
        <!-- ------ -->

        <!-- ------ -->
        <h:panelGroup layout="block" styleClass="" id="dvPricelist" rendered="#{not empty PricelistsPlain.items}">
            <h:dataTable value="#{PricelistsPlain.items}" var="item" cellpadding="0" cellspacing="0" id="tblPricelist" styleClass="tbl1"
                    columnClasses="c__gcb,c__gc">
                <f:facet name="header">
                    <h:outputText value="Прайс"/>
                </f:facet>

                <rich:column>
                    <f:facet name="header">
                        <h:outputText value="Код"/>
                    </f:facet>
                    <h:outputText value="#{item.good.code}"/>
                </rich:column>
                <rich:column>
                    <f:facet name="header">
                        <h:outputText value="Наименование"/>
                    </f:facet>
                    <h:outputText value="#{item.good.name}"/>
                </rich:column>

                <rich:column rendered="#{!empty(PricelistsPlain.clientGroups[0])}">
                    <f:facet name="header">
                        <h:outputText value="#{PricelistsPlain.clientGroups[0].name}" styleClass=""/>
                    </f:facet>
                    <h:outputText value="#{item.prices[PricelistsPlain.clientGroups[0].id].value}" converter="MoneyConverter"/>
                </rich:column>
                <rich:column rendered="#{!empty(PricelistsPlain.clientGroups[1])}">
                    <f:facet name="header">
                        <h:outputText value="#{PricelistsPlain.clientGroups[1].name}" styleClass=""/>
                    </f:facet>
                    <h:outputText value="#{item.prices[PricelistsPlain.clientGroups[1].id].value}" converter="MoneyConverter"/>
                </rich:column>
                <rich:column rendered="#{!empty(PricelistsPlain.clientGroups[2])}">
                    <f:facet name="header">
                        <h:outputText value="#{PricelistsPlain.clientGroups[2].name}" styleClass=""/>
                    </f:facet>
                    <h:outputText value="#{item.prices[PricelistsPlain.clientGroups[2].id].value}" converter="MoneyConverter"/>
                </rich:column>
                <rich:column rendered="#{!empty(PricelistsPlain.clientGroups[3])}">
                    <f:facet name="header">
                        <h:outputText value="#{PricelistsPlain.clientGroups[3].name}" styleClass=""/>
                    </f:facet>
                    <h:outputText value="#{item.prices[PricelistsPlain.clientGroups[3].id].value}" converter="MoneyConverter"/>
                </rich:column>
                <rich:column rendered="#{!empty(PricelistsPlain.clientGroups[4])}">
                    <f:facet name="header">
                        <h:outputText value="#{PricelistsPlain.clientGroups[4].name}" styleClass=""/>
                    </f:facet>
                    <h:outputText value="#{item.prices[PricelistsPlain.clientGroups[4].id].value}" converter="MoneyConverter"/>
                </rich:column>
                <rich:column rendered="#{!empty(PricelistsPlain.clientGroups[5])}">
                    <f:facet name="header">
                        <h:outputText value="#{PricelistsPlain.clientGroups[5].name}" styleClass=""/>
                    </f:facet>
                    <h:outputText value="#{item.prices[PricelistsPlain.clientGroups[5].id].value}" converter="MoneyConverter"/>
                </rich:column>
                <rich:column rendered="#{!empty(PricelistsPlain.clientGroups[6])}">
                    <f:facet name="header">
                        <h:outputText value="#{PricelistsPlain.clientGroups[6].name}" styleClass=""/>
                    </f:facet>
                    <h:outputText value="#{item.prices[PricelistsPlain.clientGroups[6].id].value}" converter="MoneyConverter"/>
                </rich:column>
                <rich:column rendered="#{!empty(PricelistsPlain.clientGroups[7])}">
                    <f:facet name="header">
                        <h:outputText value="#{PricelistsPlain.clientGroups[7].name}" styleClass=""/>
                    </f:facet>
                    <h:outputText value="#{item.prices[PricelistsPlain.clientGroups[7].id].value}" converter="MoneyConverter"/>
                </rich:column>
                <rich:column rendered="#{!empty(PricelistsPlain.clientGroups[8])}">
                    <f:facet name="header">
                        <h:outputText value="#{PricelistsPlain.clientGroups[8].name}" styleClass=""/>
                    </f:facet>
                    <h:outputText value="#{item.prices[PricelistsPlain.clientGroups[8].id].value}" converter="MoneyConverter"/>
                </rich:column>
                <rich:column rendered="#{!empty(PricelistsPlain.clientGroups[9])}">
                    <f:facet name="header">
                        <h:outputText value="#{PricelistsPlain.clientGroups[9].name}" styleClass=""/>
                    </f:facet>
                    <h:outputText value="#{item.prices[PricelistsPlain.clientGroups[9].id].value}" converter="MoneyConverter"/>
                </rich:column>
                <rich:column rendered="#{!empty(PricelistsPlain.clientGroups[10])}">
                    <f:facet name="header">
                        <h:outputText value="#{PricelistsPlain.clientGroups[10].name}" styleClass=""/>
                    </f:facet>
                    <h:outputText value="#{item.prices[PricelistsPlain.clientGroups[10].id].value}" converter="MoneyConverter"/>
                </rich:column>
                <rich:column rendered="#{!empty(PricelistsPlain.clientGroups[11])}">
                    <f:facet name="header">
                        <h:outputText value="#{PricelistsPlain.clientGroups[11].name}" styleClass=""/>
                    </f:facet>
                    <h:outputText value="#{item.prices[PricelistsPlain.clientGroups[11].id].value}" converter="MoneyConverter"/>
                </rich:column>
                <rich:column rendered="#{!empty(PricelistsPlain.clientGroups[12])}">
                    <f:facet name="header">
                        <h:outputText value="#{PricelistsPlain.clientGroups[12].name}" styleClass=""/>
                    </f:facet>
                    <h:outputText value="#{item.prices[PricelistsPlain.clientGroups[12].id].value}" converter="MoneyConverter"/>
                </rich:column>
                <rich:column rendered="#{!empty(PricelistsPlain.clientGroups[13])}">
                    <f:facet name="header">
                        <h:outputText value="#{PricelistsPlain.clientGroups[13].name}" styleClass=""/>
                    </f:facet>
                    <h:outputText value="#{item.prices[PricelistsPlain.clientGroups[13].id].value}" converter="MoneyConverter"/>
                </rich:column>
                <rich:column rendered="#{!empty(PricelistsPlain.clientGroups[14])}">
                    <f:facet name="header">
                        <h:outputText value="#{PricelistsPlain.clientGroups[14].name}" styleClass=""/>
                    </f:facet>
                    <h:outputText value="#{item.prices[PricelistsPlain.clientGroups[14].id].value}" converter="MoneyConverter"/>
                </rich:column>
                <rich:column rendered="#{!empty(PricelistsPlain.clientGroups[15])}">
                    <f:facet name="header">
                        <h:outputText value="#{PricelistsPlain.clientGroups[15].name}" styleClass=""/>
                    </f:facet>
                    <h:outputText value="#{item.prices[PricelistsPlain.clientGroups[15].id].value}" converter="MoneyConverter"/>
                </rich:column>
                <rich:column rendered="#{!empty(PricelistsPlain.clientGroups[16])}">
                    <f:facet name="header">
                        <h:outputText value="#{PricelistsPlain.clientGroups[16].name}" styleClass=""/>
                    </f:facet>
                    <h:outputText value="#{item.prices[PricelistsPlain.clientGroups[16].id].value}" converter="MoneyConverter"/>
                </rich:column>
                <rich:column rendered="#{!empty(PricelistsPlain.clientGroups[17])}">
                    <f:facet name="header">
                        <h:outputText value="#{PricelistsPlain.clientGroups[17].name}" styleClass=""/>
                    </f:facet>
                    <h:outputText value="#{item.prices[PricelistsPlain.clientGroups[17].id].value}" converter="MoneyConverter"/>
                </rich:column>
                <rich:column rendered="#{!empty(PricelistsPlain.clientGroups[18])}">
                    <f:facet name="header">
                        <h:outputText value="#{PricelistsPlain.clientGroups[18].name}" styleClass=""/>
                    </f:facet>
                    <h:outputText value="#{item.prices[PricelistsPlain.clientGroups[18].id].value}" converter="MoneyConverter"/>
                </rich:column>
                <rich:column rendered="#{!empty(PricelistsPlain.clientGroups[19])}">
                    <f:facet name="header">
                        <h:outputText value="#{PricelistsPlain.clientGroups[19].name}" styleClass=""/>
                    </f:facet>
                    <h:outputText value="#{item.prices[PricelistsPlain.clientGroups[19].id].value}" converter="MoneyConverter"/>
                </rich:column>
                <rich:column rendered="#{!empty(PricelistsPlain.clientGroups[20])}">
                    <f:facet name="header">
                        <h:outputText value="#{PricelistsPlain.clientGroups[20].name}" styleClass=""/>
                    </f:facet>
                    <h:outputText value="#{item.prices[PricelistsPlain.clientGroups[20].id].value}" converter="MoneyConverter"/>
                </rich:column>
                <rich:column rendered="#{!empty(PricelistsPlain.clientGroups[21])}">
                    <f:facet name="header">
                        <h:outputText value="#{PricelistsPlain.clientGroups[21].name}" styleClass=""/>
                    </f:facet>
                    <h:outputText value="#{item.prices[PricelistsPlain.clientGroups[21].id].value}" converter="MoneyConverter"/>
                </rich:column>

            </h:dataTable>
        </h:panelGroup>
    </h:panelGroup>
</f:view>
<script type="text/javascript">
    highlightTableRows("tblPricelist", "hooverRow");
</script>
</body>
</html>
